package builder 
{
	import app.AppModel;
	import app.FurnitureClass;
	import app.FurnitureType;
	import app.TextureInfo;
	import app.TextureInfoGroupe;
	import furnitures.FurnitureFactory;
	import resources.Images;
	/**
	 * ...
	 * @author Dmitriy Gaiduk
	 */
	public class TestAppBuilder implements IAppBuilder
	{
		private var _model:AppModel;
		
		public function TestAppBuilder(model:AppModel) 
		{
			_model = model;
		}
		
		/* INTERFACE builder.IAppBuilder */
		
		public function start():void 
		{
			_model.inited = false;
			_model.facadeTextures = new Vector.<TextureInfoGroupe>();
			var textures:Vector.<TextureInfo>;
			textures = new Vector.<TextureInfo>();
			textures.push(new TextureInfo(Images.getBitmapData(Images.Wood1),"Дерево 1"));
			textures.push(new TextureInfo(Images.getBitmapData(Images.Wood2), "Дерево 2"));
			_model.facadeTextures.push(new TextureInfoGroupe("Крашенный МДФ", textures));
			_model.currentFacadeTexture = textures[0];
			
			textures = new Vector.<TextureInfo>();
			textures.push(new TextureInfo(Images.getBitmapData(Images.Wood1),"Дерево 3"));
			textures.push(new TextureInfo(Images.getBitmapData(Images.Wood2), "Дерево 4"));
			_model.facadeTextures.push(new TextureInfoGroupe("Массив", textures));
			
			textures = new Vector.<TextureInfo>();
			textures.push(new TextureInfo(Images.getBitmapData(Images.Wood1),"Дерево 5"));
			textures.push(new TextureInfo(Images.getBitmapData(Images.Wood2), "Дерево 6"));
			_model.facadeTextures.push(new TextureInfoGroupe("Лондон/Париж", textures));
			
			_model.tabletopTextures = new Vector.<TextureInfoGroupe>();
			textures = new Vector.<TextureInfo>();
			textures.push(new TextureInfo(Images.getBitmapData(Images.Tabletop1),"Столешница 1"));
			textures.push(new TextureInfo(Images.getBitmapData(Images.Tabletop2),"Столешница 2"));
			textures.push(new TextureInfo(Images.getBitmapData(Images.Tabletop3), "Столешница 3"));
			_model.tabletopTextures.push(new TextureInfoGroupe("Пластиковые Столешницы", textures));
			_model.currentTabletopTexture = textures[0];
			
			textures = new Vector.<TextureInfo>();
			textures.push(new TextureInfo(Images.getBitmapData(Images.Tabletop1),"Столешница 4"));
			textures.push(new TextureInfo(Images.getBitmapData(Images.Tabletop2),"Столешница 5"));
			textures.push(new TextureInfo(Images.getBitmapData(Images.Tabletop3), "Столешница 6"));
			_model.tabletopTextures.push(new TextureInfoGroupe("Столешницы из искуственного камня", textures));
			
			// room
			_model.roomHeight = 150;
			_model.roomLength = 150;
			_model.roomWidth = 150;
			
			// bottom furnitures
			_model.bottomFurnitures = new Vector.<FurnitureClass>();
			var furnClass:FurnitureClass = new FurnitureClass("С дверцами");
			furnClass.addFurnitureType(new FurnitureType("Угловые радиусные",
											FurnitureFactory.createCornerCabinetRadius90(),
											Images.getImage(Images.FurnCornerCircle)));
			furnClass.addFurnitureType(new FurnitureType("Верхние выпуклые",
											FurnitureFactory.createUpperCabinetR1000(),
											Images.getImage(Images.FurnUpCircle)));
			furnClass.addFurnitureType(new FurnitureType("Угловые",
										FurnitureFactory.createCornerCabinet90x90(),
										Images.getImage(Images.FurnCorner)));
			_model.bottomFurnitures.push(furnClass);
			
			furnClass = new FurnitureClass("С ящиками");
			furnClass.addFurnitureType(new FurnitureType("1 ящик"));
			furnClass.addFurnitureType(new FurnitureType("2 ящика"));
			furnClass.addFurnitureType(new FurnitureType("3 ящика"));
			furnClass.addFurnitureType(new FurnitureType("3-1 ящики"));
			_model.bottomFurnitures.push(furnClass);
			
			furnClass = new FurnitureClass("Угловые");
			furnClass.addFurnitureType(new FurnitureType("Угол 90х90"));
			furnClass.addFurnitureType(new FurnitureType("Шкаф угловой пристыковачный"));
			_model.bottomFurnitures.push(furnClass);
			
			furnClass = new FurnitureClass("Под технику");
			furnClass.addFurnitureType(new FurnitureType("Под духовой шкаф"));
			furnClass.addFurnitureType(new FurnitureType("Посудомойка"));
			furnClass.addFurnitureType(new FurnitureType("Стиральная машина"));
			_model.bottomFurnitures.push(furnClass);
			
			_model.inited = true;
		}
		
		public function destroy():void 
		{
			_model = null;
		}
		
	}

}